import java.util.Arrays;

public class O56 {
    public static void main(String[] args) {
        O56 o  = new O56();
        System.out.println(Arrays.toString(o.singleNumbers(new int[]{6, 5, 5, 9, 10, 9, 4, 10})));
    }
    public int[] singleNumbers(int[] nums) {
        int t = 0;
        for (int j : nums) {
            t ^= j;
        }
        int tar = 0;
        for (int i = 0; i < 32; i++) {
            if (((t>>i)&1)==1){
                tar = i;
                break;
            }
        }
        int[] re = new int[2];
        for (int num : nums) {
            if ((num >> tar & 1)==1) {
                re[0] = re[0] ^ num;
            } else re[1] = re[1] ^ num;
        }
        return re;
    }
}
